package net.suncapper.wcss.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import net.suncapper.wcss.model.domain.Dictionary;
import net.suncapper.wcss.mapper.DictionaryMapper;
import net.suncapper.wcss.service.IDictionaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 数据字典 服务实现类
 * </p>
 *
 * @author ztr
 * @since 2025-11-05
 */
@Service
public class DictionaryServiceImpl extends ServiceImpl<DictionaryMapper, Dictionary> implements IDictionaryService {

    @Override
    public List<Dictionary> listByType(String type) {
        return this.list(Wrappers.<Dictionary>lambdaQuery().eq(Dictionary::getType, type).ne(Dictionary::getParentId,0));
    }
}
